home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Amiga Plus Special 24
/
AMIGAplus Sonderheft 24 (2000)(Falke)(DE)[!].iso
/
PublicDomain
/
Anwendungen
/
MT-RechnungIII
/
Rexx
/
FWKundenüber.cusrexx
< prev
next >
Wrap
Text File
|
1998-11-16
|
4KB
|
185 lines
/*
** Druck-, Vorschau, Sichern der Kundenübersicht mit Hilfe von FinalWriter
** $VER: FWKundenüber.cusrexx V1.00 (17.11.98)
*/
PARSE ARG ARexxPort;
ADDRESS VALUE ARexxPort;
OPTIONS RESULTS;
FWVorlage = "FWDokumente/Kundenübersicht.fw";
FWDokument = "t:Kundenübersicht.fw";
FWPort = "FINALW."
LF = '0a'x; /* Zeilenvorschub */
Gefunden = 0;
DO i = 1 TO 20 WHILE(Gefunden = 0)
IF show(ports, (FWPort || i)) THEN
DO;
Gefunden = 1;
FWPort = FWPort || i;
END;
END;
IF Gefunden = 0 THEN
DO;
ES_TITLE = "Warnung";
ES_TEXTFORMAT = "FinalWriter ist nicht aktiv, bitte starten sie dieses" || LF || "und versuchen Sie es erneut";
ES_GADGETFORMAT = "Abbrechen";
EASY_REQUEST;
EXIT;
END;
/* Original FW-Dokument nach t: kopieren, um ein versehentliches überschreiben */
/* dieser Vorlage zu verhindern */
GET_REXXPATH;
FWVorlage = MTR_RESULT || FWVorlage;
ADDRESS COMMAND "copy" FWVorlage FWDokument;
/* Oberfläche sperren */
LOCKGUI;
/* Art ermitteln: 0 = Drucken, 1 = Vorschau, 2 = Speichern */
PRINTSTATE;
Druckart = MTR_RESULT;
Ende_Kennzeichen = 'N';
/* Suchen der zu druckenden Daten */
GET_PREFS;
PRINTFIND;
DO WHILE( MTR_RESULT > 0 & Ende_Kennzeichen = 'N');
ADDRESS VALUE FWPort;
SCREENTOFRONT;
CALL DatenAufbereiten;
SELECT;
WHEN Druckart = 0 THEN /* Drucken */
DO;
ADDRESS VALUE FWPort;
PRINT;
ADDRESS VALUE ARexxPort;
MTSCREENTOFRONT;
END;
WHEN Druckart = 1 THEN /* Vorschau */
ADDRESS VALUE ARexxPort;
WHEN Druckart = 2 THEN /* Sichern */
DO;
ADDRESS VALUE FWPort;
SAVEAS;
ADDRESS VALUE ARexxPort;
MTSCREENTOFRONT;
END;
OTHERWISE
DO;
ES_TITLE = "Warnung";
ES_TEXTFORMAT = "Druckart wird nicht unterstützt!";
ES_GADGETFORMAT = "Ok";
EASY_REQUEST;
Ende_Kennzeichen = 'J';
END;
END;
PRINTFIND;
END;
/* WordWorth-Datei aus t: wieder entfernen */
ADDRESS COMMAND "delete" FWDokument;
/* Oberfläche wieder entsperren */
ADDRESS VALUE ARexxPort;
FREEGUI;
EXIT;
DatenAufbereiten:
ADDRESS VALUE FWPort;
CLEARDOC;
OPEN FWDokument;
FIND "<NR>";
FINDNEXT;
STATUS LinePos;
PARSE VAR RESULT BegLine BegPosition EndLine EndPosition;
MoveToLine BegLine 0;
ShiftDown;
MoveToLine (BegLine + 2) 0;
ShiftUp;
CUT;
DO WHILE( MTR_RESULT > 0 & Ende_Kennzeichen = 'N');
ADDRESS VALUE FWPort;
PASTE;
IF PREFS.NUMBER_DIGITS > 0 THEN
ZW_Nummer = RIGHT( (Copies("0",PREFS.NUMBER_DIGITS) || MTR_RESULT), PREFS.NUMBER_DIGITS );
ELSE
ZW_Nummer = MTR_RESULT;
IF CUSTOMER.ADDRESS.COMPANY1 > "" THEN
ZW_Name = CUSTOMER.ADDRESS.COMPANY1;
ELSE
ZW_Name = CUSTOMER.ADDRESS.PRENAME CUSTOMER.ADDRESS.SURNAME;
IF BegLine > 3 THEN
MoveToLine (BegLine - 3) 0;
ELSE
MoveToLine 1 0;
FIND "<NR>";
STATUS LinePos;
PARSE VAR RESULT BegLine BegPosition EndLine EndPosition;
TYPE ZW_Nummer;
FIND "<COMPANY_NAME>";
IF ZW_NAME = "" THEN
TYPE " ";
ELSE
TYPE ZW_Name;
FIND "<STREET>";
IF CUSTOMER.ADDRESS.STREET = "" THEN
TYPE " ";
ELSE
TYPE CUSTOMER.ADDRESS.STREET;
FIND "<ZIP>";
IF CUSTOMER.ADDRESS.ZIP = "" THEN
TYPE " ";
ELSE
TYPE CUSTOMER.ADDRESS.ZIP;
FIND "<CITY>";
IF CUSTOMER.ADDRESS.CITY = "" THEN
TYPE " ";
ELSE
TYPE CUSTOMER.ADDRESS.CITY;
FIND "<PHONE>";
IF CUSTOMER.ADDRESS.PHONE = "" THEN
TYPE " ";
ELSE
TYPE CUSTOMER.ADDRESS.PHONE;
FIND "<FAX>";
IF CUSTOMER.ADDRESS.FAX = "" THEN
TYPE " ";
ELSE
TYPE CUSTOMER.ADDRESS.FAX;
FIND "<E-MAIL>";
IF CUSTOMER.ADDRESS.EMAIL.0 = "" THEN
TYPE " ";
ELSE
TYPE CUSTOMER.ADDRESS.EMAIL.0;
MoveToLine (BegLine + 2) 0;
ADDRESS VALUE ARexxPort;
PRINTFIND;
END;
RETURN;